//
//  XPlanModel.m
//  iPlan
//
//  Created by 侯伟 on 2021/8/29.
//

#import "XPlanModel.h"
#import <Realm/Realm.h>

@implementation XPlanModel

+ (nullable NSDictionary *)defaultPropertyValues{
    return @{@"planCount":@(0)};
}

+ (NSArray *)ignoredProperties {
    return @[@"state"];
}


+ (nullable NSString *)primaryKey{
    return @"id";
}


- (instancetype)init
{
    self = [super init];
    if (self) {
        _id = [[NSDate date] timeIntervalSince1970];
    }
    return self;
}

- (id)mutableCopyWithZone:(nullable NSZone *)zone{
    NSString* json = [self yy_modelToJSONObject];
    return [XPlanModel yy_modelWithJSON:json];
}

@end
